home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_doorblocks.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  110 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_Door.cog
  4. #
  5. # Generic Door Script
  6. #
  7. # [IS]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup        
  15.     message        activate    
  16.     message        arrived        
  17.     message     timer        
  18.     message        blocked        
  19.  
  20.     thing       door0       linkid=0    mask=0x405
  21.     thing       block0      linkid=1    mask=0x405
  22.     thing       block1      linkid=1    mask=0x405
  23.     thing       player      local
  24.  
  25.     float        moveSpeed=8.0
  26.     float        sleepTime=2.0
  27.  
  28.     vector      vecLightValue           local
  29.  
  30.     sector      doorSector              
  31.         
  32.     int         screen=0                local
  33.     
  34. end
  35.  
  36. # ========================================================================================
  37.  
  38. code
  39.  
  40. startup:
  41.  
  42.     player = GetLocalPlayerThing();
  43.     doorSector = GetThingSector(door0);
  44.     SetSectorAdjoins(doorSector, 0);
  45.     
  46. return;
  47.  
  48. # ........................................................................................
  49.  
  50. activate:
  51.  
  52.     if ((GetSenderID() == 1) && (GetCurFrame(door0) == 0) && (screen == 0))
  53.     {
  54.         screen=1;
  55.         StopThing(player);
  56.         SetActorFlags(player, 0x200000);
  57.         StartCutscene(1);
  58.         PlayMode(player, 60, 0);
  59.         Sleep(0.5);    
  60.         SetSectorAdjoins(doorSector, 1);
  61.         MoveToFrame(door0, 1, moveSpeed);
  62.         MoveToFrame(block0, 1,  (moveSpeed * 2));
  63.         MoveToFrame(block1, 1,  (moveSpeed * 2));
  64.         WaitForStop(block0);
  65.         Sleep(0.5);
  66.         EndCutscene(0);
  67.         ClearActorFlags(player, 0x200000);
  68.         screen=0;
  69.     }
  70.     
  71. return;
  72.  
  73. # ........................................................................................
  74.  
  75. arrived:
  76.  
  77.     if ((GetCurFrame(door0) == 1) && (GetSenderID() == 0))
  78.     {
  79.         SetTimer(sleepTime);
  80.     }
  81.     else
  82.     {
  83.         SetSectorAdjoins(doorSector, 1);
  84.     }
  85.     
  86. return;
  87.  
  88. # ........................................................................................
  89.  
  90. blocked:
  91.  
  92.     MoveToFrame(door0, 1, moveSpeed);
  93.     
  94. return;
  95.  
  96. # ........................................................................................
  97.  
  98. timer:
  99.  
  100.     MoveToFrame(door0, 0, moveSpeed);
  101.     MoveToFrame(block0, 0,  (moveSpeed * 2));
  102.     MoveToFrame(block1, 0,  (moveSpeed * 2));
  103.     
  104. return;
  105.  
  106. # ........................................................................................
  107.  
  108. end
  109.  
  110.